{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[Taichi] version 1.0.4, llvm 10.0.0, commit c133fd4f, linux, python 3.8.5\n",
      "[I 07/14/22 04:28:58.464 58202] [shell.py:_shell_pop_print@33] Graphical python shell detected, using wrapped sys.stdout\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/xuhao/anaconda3/lib/python3.8/site-packages/taichi/__init__.py:71: DeprecationWarning: ti.types.ndarray is deprecated. Please use ti.types.ndarray instead.\n",
      "  warnings.warn(\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[Taichi] Starting on arch=cuda\n",
      "[I 07/14/22 04:28:59.609 58202] [vulkan_device_creator.cpp:pick_physical_device@364] Found Vulkan Device 0 (NVIDIA GeForce RTX 3080)\n",
      "[I 07/14/22 04:28:59.609 58202] [vulkan_device_creator.cpp:pick_physical_device@364] Found Vulkan Device 1 (llvmpipe (LLVM 12.0.0, 256 bits))\n",
      "[I 07/14/22 04:28:59.609 58202] [vulkan_device_creator.cpp:find_queue_families@142] Async compute queue 2, graphics queue 0\n",
      "[I 07/14/22 04:28:59.609 58202] [vulkan_device_creator.cpp:find_queue_families@142] Async compute queue 2, graphics queue 0\n",
      "[I 07/14/22 04:28:59.609 58202] [vulkan_device_creator.cpp:create_logical_device@432] Vulkan Device \"NVIDIA GeForce RTX 3080\" supports Vulkan 0 version 1.3.205\n"
     ]
    }
   ],
   "source": [
    "%load_ext autoreload\n",
    "%autoreload 2\n",
    "\n",
    "import sys\n",
    "sys.path.append(\"../\")\n",
    "from taichi_slam.mapping import *\n",
    "from taichi_slam.utils.visualization import *\n",
    "\n",
    "ti.init(arch=ti.cuda)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "TSDF map initialized blocks 64x64x7\n",
      "[SubmapMapping] Loading 225288 voxels map from /home/xuhao/output/test_map.npy\n",
      "[W 07/14/22 04:29:04.521 58202] [vulkan_device.cpp:buffer@615] Overriding last binding\n"
     ]
    }
   ],
   "source": [
    "densemap = DenseTSDF.loadMap(\"/home/xuhao/output/test_map.npy\")\n",
    "densemap.cvt_TSDF_surface_to_voxels()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.8.5 ('base')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "08ce52785f0fedc81003ce387e097a83d6cc9494681cd746006386992005bb71"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
